package com.baidu.structure.utils;

import android.app.Activity;
import android.content.Intent;

import com.baidu.structure.R;
import com.baidu.structure.constants.Keys;

/**
 * Created by sunmo on 2016/10/23.
 */
public class JumpUtils {

    //simple jump
    public static void simpleJump(Activity from, Class<?> to) {
        from.overridePendingTransition(R.anim.push_left_in,R.anim.push_right_out);
        from.startActivity(new Intent(from, to));
    }
    public static void simpleJump(Activity from, Intent intent) {
        from.overridePendingTransition(R.anim.push_left_in,R.anim.push_right_out);
        from.startActivity(intent);
    }

    //jump with callback
    public static void jumpWithCallback(Activity from,Class<?> to){
        from.startActivityForResult(new Intent(from,to), Keys.LOGIN_REQUEST);
    }
    //
}
